﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace NDI.Tests
{
    [TestClass]
    public class ServiceEntryFixture
    {
        [TestMethod]
        public void CloingServiceEntryAllPropertiesButContainer()
        {
            var entry = new ServiceEntry
            {
                Factory = new object(),
                Instance = new object(),
                Scope = ReuseScope.None,
                Container = new Container(),
                Owner = Owner.External,
            };

            var entry1 = entry.CloneFor(new Container());

            Assert.AreSame(entry.Factory, entry1.Factory);
            Assert.AreEqual(entry.Owner, entry1.Owner);
            Assert.AreEqual(entry.Scope, entry1.Scope);
            Assert.AreNotEqual(entry.Instance, entry1.Instance);
            Assert.AreNotEqual(entry.Container, entry1.Container);
        }
    }
}
